#include "include/SDL.h"
#include "object.h"
#include <string>
#include <list>
#include <windows.h>
#include "map.h"
#define MAX(X,Y) ((X) < (Y) ? (Y) : (X))
#define MIN(X,Y) ((X) < (Y) ? (X) : (Y))
using namespace std;
struct camera
{
int xCamera;
int yCamera;
};
class renderer
{

SDL_Surface* screen;
SDL_Surface* background;
SDL_Rect grasp;
int graspColor;
gameobject* selection;
public:
static const int cellSize=1;
static const int screenWidthCells=640;
static const int screenHeightCells=480;
static const int tileSize=128;
bool shouldDrawGrasp;
camera gameCamera;
renderer(){}
~renderer();
void Initialize(string windowCaption, string iconPath);
void RenderFrame(list<gameobject>* gameObjects, map* currentMap);
void DrawObject(gameobject& gObject);
bool InCamera(int x, int y);
int XScrToMap(int x);
int YScrToMap(int y);
int XMapToScr(int x);
int YMapToScr(int y);
void DrawRectangle(int x, int y, int w, int h, int color);
void DrawDecoration(mapElement& decoration);
void DrawSelectionRect(SDL_Surface *screen, int x1, int y1, int x2, int y2, unsigned int color);
void renderer::SetPixel(int x, int y, Uint32 color);
};